﻿using Adalbertus.BudgetPlanner.Domain;
using FluentNHibernate.Mapping;

namespace Adalbertus.BudgetPlanner.Infrastructure.Mapping
{
    public class BudgetPlanMap : ClassMap<BudgetPlan>
    {
        public BudgetPlanMap()
        {
            Id(x => x.Id);

            References(x => x.Budget);
            References(x => x.Flow).Not.Nullable();
            HasMany(x => x.Details).Cascade.AllDeleteOrphan();
        }
    }
}
